<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
<head th:insert="fragments/head"></head>
<body>
<header th:insert="fragments/header"></header>

<main>
    <div class="container">
        <h3 class="center">Nuevo Estudiante</h3>
        <br>
        <div class="row">
            <div class="section col s12 l6 offset-l3">
                <form action="#" method="post"
                      th:object="${student}"
                      th:action="@{/students/save}"
                >

                    <div class="input-field">
                        <label for="first_name">Nombre</label>
                        <input type="text" class="class-controller"
                               id="first_name"
                               th:field="*{firstName}" autofocus required
                        >
                    </div>

                    <div class="input-field">
                        <label for="last_name">Apellido</label>
                        <input type="text" class="class-controller"
                               id="last_name"
                               th:field="*{lastName}" required
                        >
                    </div>

                    <div class="input-field">
                        <label for="email">Correo Electrónico</label>
                        <input type="email" class="class-controller"
                               id="email"
                               th:field="*{email}" required
                        >
                    </div>

                    <div class="input-field">
                        <label for="description">Descripción</label>
                        <input type="text" class="class-controller"
                               id="description"
                               th:field="*{description}" required
                        >
                    </div>

                    <div class="input-field">
                        <label for="details">Detalles</label>
                        <textarea class="materialize-textarea"
                                  id="details"
                                  th:field="*{details}"></textarea>
                    </div>

                    <div class="input-field">
                        <label for="imgurl">URL Imagen</label>
                        <input type="text" class="class-controller"
                               id="imgurl"
                               th:field="*{imgurl}" required
                        >
                    </div>

                    <button type="submit" class="btn">
                        Confirmar
                    </button>
                    <a th:href="@{/students}" class="btn red lighten-1">Atrás</a>

                </form>
            </div>
        </div>
    </div>
</main>
<br><br>
<footer class="page-footer teal" th:insert="fragments/footer"></footer>

<!--  Scripts-->
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script src="/js/materialize.js"></script>
<script src="/js/init.js"></script>
</body>
</html>
